<?php
/**
 * Created by PhpStorm.
 * User: suruixiang
 * Date: 2017/10/16
 * Time: 下午1:42
 */
namespace app\api\controller;

use think\Request;
use think\Controller;

class Common extends Controller
{
    public function _initialize()
    {
        if (!checkRiskString()) {
            if (Request::instance()->isPost()) {
                abort(200, json_encode([
                    'code' => 0,
                    'msg'  => '输入存在危险字符,已被系统拦截'
                ]));
            } else {
                $this->error('输入存在危险字符,已被系统拦截');
            }
        }
    }
    //空操作
    public function _empty()
    {
        return view('common/error', [
            'message' => '对不起，系统出现问题！'
        ]);
    }
}